package com.tuo51.foudation.constant;

import org.apache.commons.lang3.StringUtils;

public enum ChannelConfig {
    DEFAULT_MAIL_CONFIG(null, null, null),
    KX_MAIL_CONFIG("kx", "小康轩测评报告", "测评报告"),
    MSDD_MAIL_CONFIG("msdd", "麻糬豆豆成长测评报告", "测评报告");

    public static ChannelConfig forChannel(String channel) {
        if (StringUtils.isEmpty(channel)){
            return DEFAULT_MAIL_CONFIG;
        }
        switch (channel) {
            case "kx": return KX_MAIL_CONFIG;
            case "msdd": return MSDD_MAIL_CONFIG;
            default: return DEFAULT_MAIL_CONFIG;
        }
    }

    private String channel;
    private String mailFromName;
    private String reportNameTail;

    ChannelConfig(String channel, String mailFromName, String reportNameTail){
        this.channel = channel;
        this.mailFromName = mailFromName;
        this.reportNameTail = reportNameTail;
    }

    public String getChannel(){return this.channel;}
    public String getMailFromName(){return this.mailFromName;}
    public String getReportNameTail(){return this.reportNameTail;}
}
